package com.zs4sdk.entity;

import org.json.JSONObject;

import com.common.library.entity.JSONResultEntity;
import com.common.library.util.Helper;

/**
 * 
 * 
 * function: 指易付初始化返回类
 * 
 * @ author:LiPeng 2014-2-17 下午3:39:16
 */
public class SkyPayInitJSONResultEntity extends JSONResultEntity {
	
	public static final String COLUM_MERCHANTSIGN = "merchantSign";
	public static final String COLUM_MERCHANTID = "merchantId";
	public static final String COLUM_APPID = "appid";
	public static final String COLUM_APPNAME = "appName";
	public static final String COLUM_NOTIFYADDRESS = "notifyAddress";
//	public static final String COLUM_PRICE = "price";
//	public static final String COLUM_CHANNELID = "channelId";
	public static final String COLUM_PAYPOINTNUM = "payPointNum";
	public static final String COLUM_ORDERDESC = "orderDesc";
	
	private String merchantSign;
	private String merchantId;
	
	

	private String appid;
	private String appName;
	private String notifyAddress;
//	private String price;
//	private String channelId;
	private String payPointNum;
	private String orderDesc;
	
	VersionJSONResultEntity entity;
	
	/*
	 * 构造方法
	 */
	public SkyPayInitJSONResultEntity() {
		
	}
	
	/*
	 * 构造方法
	 * @param json
	 */
	public SkyPayInitJSONResultEntity(JSONObject json){
		this.fromJSON(json);
	}
	
	/*
	 * 构造方法
	 * @param jsonStr
	 */
	public SkyPayInitJSONResultEntity(String jsonStr){
		try {
			this.fromJSON(new JSONObject(jsonStr));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public SkyPayInitJSONResultEntity(SkyPayInitJSONResultEntity entity){
		this.merchantSign = entity.getMerchantSign();
		this.merchantId = entity.getMerchantId();
		this.appid = entity.getAppId();
		this.appName = entity.getAppName();
		this.notifyAddress = entity.getNotifyAddress();
//		this.price = entity.getPrice();
//		this.channelId = entity.getChannelId();
		this.payPointNum = entity.getPayPointNum();
		this.orderDesc = entity.getOrderDesc();
	}
	
	//#endregion 构造方法

	//#region Override方法
	@Override
	public JSONObject toJSON(){
		JSONObject result = super.toJSON();
		try {
			result.put(COLUM_MERCHANTSIGN, this.merchantSign);
			result.put(COLUM_MERCHANTID, this.merchantId);
			result.put(COLUM_APPID, this.appid);
			result.put(COLUM_APPNAME, this.appName);
			result.put(COLUM_NOTIFYADDRESS, this.notifyAddress);
//			result.put(COLUM_PRICE, this.price);
//			result.put(COLUM_CHANNELID, this.channelId);
			result.put(COLUM_PAYPOINTNUM, this.payPointNum);
			result.put(COLUM_ORDERDESC, this.orderDesc);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	
	@Override
	public void fromJSON(JSONObject json){
		super.fromJSON(json);
		if(Helper.isNotEmpty(json)){
			this.merchantSign = json.optString(COLUM_MERCHANTSIGN);
			this.merchantId = json.optString(COLUM_MERCHANTID);
			this.appid = json.optString(COLUM_APPID);
			this.appName = json.optString(COLUM_APPNAME);
			this.notifyAddress = json.optString(COLUM_NOTIFYADDRESS);
//			this.price = json.optString(COLUM_PRICE);
//			this.channelId = json.optString(COLUM_CHANNELID);
			this.payPointNum = json.optString(COLUM_PAYPOINTNUM);
			this.orderDesc = json.optString(COLUM_ORDERDESC);
		}
	}
	
	
	public String getMerchantSign() {
		return merchantSign;
	}

	public void setMerchantSign(String merchantSign) {
		this.merchantSign = merchantSign;
	}

	public String getMerchantId() {
		return merchantId;
	}

	public void setMerchantId(String merchantId) {
		this.merchantId = merchantId;
	}

	public String getAppId() {
		return appid;
	}

	public void setAppId(String appId) {
		this.appid = appId;
	}

	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public String getNotifyAddress() {
		return notifyAddress;
	}

	public void setNotifyAddress(String notifyAddress) {
		this.notifyAddress = notifyAddress;
	}
//	public String getPrice() {
//		return price;
//	}
//
//	public void setPrice(String price) {
//		this.price = price;
//	}

//	public String getChannelId() {
//		return channelId;
//	}
//
//	public void setChannelId(String channelId) {
//		this.channelId = channelId;
//	}

	public String getPayPointNum() {
		return payPointNum;
	}

	public void setPayPointNum(String payPointNum) {
		this.payPointNum = payPointNum;
	}

	public String getOrderDesc() {
		return orderDesc;
	}

	public void setOrderDesc(String orderDesc) {
		this.orderDesc = orderDesc;
	}

}
